package com.xiaozhengkeji.springboot.frame.easy.Bean;

import lombok.Data;

@Data
public class ResponseBean {
    //Http状态码
    private int code;

    //返回信息
    private String msg;

    //返回的数据
    private Object data;

    public ResponseBean(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public ResponseBean ResponseACCESS(String msg, Object data) {
        this.code = 200;
        this.msg = msg;
        this.data = data;
        return this;
    }

    public ResponseBean ResponseError(String msg, Object data) {
        this.code = 500;
        this.msg = msg;
        this.data = data;
        return this;
    }

    public ResponseBean ResponseBan(String msg, Object data) {
        this.code = 403;
        this.msg = msg;
        this.data = data;
        return this;
    }
}
